﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Big_Data.View
{
    public partial class FrmMain : Form
    {


        DataBase userDB = new DataBase();
        public FrmMain()
        {
            InitializeComponent();
        }

        private void FrmMain_Load(object sender, EventArgs e)
        {

        }

        private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void FrmMain_FormClosed(object sender, FormClosedEventArgs e)
        {
            this.DialogResult = DialogResult.OK;
        }

        /// <summary>
        /// 窗口关闭进行时，提示用户是否需要关闭
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            DialogResult dialogClose = MessageBox.Show("你确定要关闭吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
            if (dialogClose != DialogResult.OK)
            {
                e.Cancel = true;
            }
        }

        private void tsm_distributor_Click(object sender, EventArgs e)
        {
            FrmDistributor distributor = new FrmDistributor();
            distributor.MdiParent = this;
            distributor.Show();
        }

        private void tsm_sataiontype_Click(object sender, EventArgs e)
        {
            FrmSataionType sataionType = new FrmSataionType();
            sataionType.MdiParent = this;
            sataionType.Show();
        }

        private void tms_area_Click(object sender, EventArgs e)
        {
            FrmArea area = new FrmArea();
            area.MdiParent = this;
            area.Show();
        }

        private void tms_assemble_Click(object sender, EventArgs e)
        {
            FrmInstallationInformation frmInstallationInformation = new FrmInstallationInformation();
            frmInstallationInformation.MdiParent = this;
            frmInstallationInformation.Show();
        }

        private void tms_report1_Click(object sender, EventArgs e)
        {
            
        }

        private void 按时间统计ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //ChaTime chart = new ChaTime();
            //chart.MdiParent = this;
            //chart.Show();

            FrmTimeChart chart2 = new FrmTimeChart();
            chart2.MdiParent = this;
            chart2.Show();
        }

        private void 地区ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmAreaChart chart = new FrmAreaChart();
            chart.MdiParent = this;
            chart.Show();
        }

        private void 分销商ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ChaDistributor chart = new ChaDistributor();
            chart.MdiParent = this;
            chart.Show();
        }

        private void tms_syslog_Click(object sender, EventArgs e)
        {
            Frm_Log chart = new Frm_Log();
            chart.MdiParent = this;
            chart.Show();
        }

        private void 安装信息统计报表ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmReport rep = new FrmReport();
            rep.MdiParent = this;
            rep.Show();
        }

        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            FrmArea area = new FrmArea();
            area.MdiParent = this;
            area.Show();
        }

        private void toolStripButton4_Click(object sender, EventArgs e)
        {
            FrmDistributor distributor = new FrmDistributor();
            distributor.MdiParent = this;
            distributor.Show();
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            FrmStation station = new FrmStation();
            station.MdiParent = this;
            station.Show();
        }

        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            FrmSataionType sataionType = new FrmSataionType();
            sataionType.MdiParent = this;
            sataionType.Show();
        }

        private void toolStripButton6_Click(object sender, EventArgs e)
        {
            FrmInstallationInformation frmInstallationInformation = new FrmInstallationInformation();
            frmInstallationInformation.MdiParent = this;
            frmInstallationInformation.Show();
        }

        private void toolStripButton7_Click(object sender, EventArgs e)
        {
            FrmReport rep = new FrmReport();
            rep.MdiParent = this;
            rep.Show();
        }

        private void toolStripButton5_Click(object sender, EventArgs e)
        {
            MessageBox.Show("功能正在建设中...");
        }

        private void tms_stations_Click(object sender, EventArgs e)
        {
            FrmStation station = new FrmStation();
            station.MdiParent = this;
            station.Show();
        }
    }
}
